// const baseURL = 'http://192.168.0.16:7084'
const baseURL = 'http://49.234.33.116:7084/'

export default function (options) {
  return new Promise((resolve, reject) => {
    wx.request({
      url: baseURL + options.url,
      method: options.method || 'get',
      data: options.data || {},
      success: res => {
        console.log(res);
        resolve(res)
      },
      fail: error => {
        console.log(error)
        wx.showToast({
          title: error.errMsg || '服务器错误',
          icon: 'error',
          duration: 2000
        })
      }
    })
  })
}